package com.keya.info;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.keya.tag.DcmTagBO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * @Description: qcinfo
 * @Author: mcw
 * @Date: 2022-07-08
 * @Version: V1.0
 */
@Data
@TableName("qc_info")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "qc_info对象", description = "qcinfo")
public class QcInfo {

    /**
     * id
     */
    @TableId(type = IdType.AUTO)
    @ApiModelProperty(value = "id")
    private Integer id;

    @ApiModelProperty(value = "type")
    private Integer type;

    /**
     * studyid
     */
    @ApiModelProperty(value = "StudyID")
    @JsonProperty(value = "StudyID")
    @TableField("StudyID")
    private String StudyID;
    /**
     * seriesnumber
     */
    @ApiModelProperty(value = "SeriesNumber")
    @JsonProperty(value = "SeriesNumber")
    @TableField("SeriesNumber")
    private String SeriesNumber;
    /**
     * accessionnumber
     */
    @ApiModelProperty(value = "AccessionNumber")
    @JsonProperty(value = "AccessionNumber")
    @TableField("AccessionNumber")
    private String AccessionNumber;
    /**
     * studyinstanceuid
     */
    @ApiModelProperty(value = "StudyInstanceUID")
    @JsonProperty(value = "StudyInstanceUID")
    @TableField("StudyInstanceUID")
    private String StudyInstanceUID;
    /**
     * seriesinstanceuid
     */
    @ApiModelProperty(value = "SeriesInstanceUID")
    @JsonProperty(value = "SeriesInstanceUID")
    @TableField("SeriesInstanceUID")
    private String SeriesInstanceUID;
    /**
     * StudyDate
     */
    @ApiModelProperty(value = "StudyDate")
    @JsonProperty(value = "StudyDate")
    @TableField("StudyDate")
    private String StudyDate;
    /**
     * seriesdate
     */
    @ApiModelProperty(value = "SeriesDate")
    @JsonProperty(value = "SeriesDate")
    @TableField("SeriesDate")
    private String SeriesDate;
    /**
     * seriestime
     */
    @ApiModelProperty(value = "SeriesTime")
    @JsonProperty(value = "SeriesTime")
    @TableField("SeriesTime")
    private String SeriesTime;

    @ApiModelProperty(value = "NumberOfSeries")
    @JsonProperty(value = "NumberOfSeries")
    @TableField("NumberOfSeries")
    private Integer NumberOfSeries;

    @ApiModelProperty(value = "aetitle")
    @JsonProperty(value = "aetitle")
    @TableField("aetitle")
    private String aetitle;

    /**
     * seriesdescription
     */
    @ApiModelProperty(value = "SeriesDescription")
    @JsonProperty(value = "SeriesDescription")
    @TableField("SeriesDescription")
    private String SeriesDescription;
    /**
     * status
     */
    @ApiModelProperty(value = "status")
    private String status;
    /**
     * qcSample
     */
    @ApiModelProperty(value = "qcSample")
    private String qcSample;
    /**
     * qcResult
     */
    @ApiModelProperty(value = "qcResult")
    private String qcResult;
    /**
     * studyPath
     */
    @ApiModelProperty(value = "studyPath")
    private String studyPath;
    /**
     * seriesMd5
     */
    @ApiModelProperty(value = "seriesMd5")
    private String seriesMd5;
    /**
     * createdAt
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "createdAt")
    private java.util.Date createdAt;
    /**
     * updatedAt
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "updatedAt")
    private java.util.Date updatedAt;


    public static QcInfo from(DcmTagBO dcmTagBO) {
        QcInfo qcInfo = new QcInfo();
        qcInfo.setSeriesNumber(dcmTagBO.getSeriesNumber() == null ? null : dcmTagBO.getSeriesNumber().toString());
        qcInfo.setStudyDate(dcmTagBO.getStudyDate());
        qcInfo.setNumberOfSeries(dcmTagBO.getNumberOfSeriesRelatedInstances());
        qcInfo.setStudyID(dcmTagBO.getStudyID());
        qcInfo.setSeriesInstanceUID(dcmTagBO.getSeriesInstanceUID());
        qcInfo.setStudyInstanceUID(dcmTagBO.getStudyInstanceUID());
        qcInfo.setAccessionNumber(dcmTagBO.getAccessionNumber());
        qcInfo.setSeriesDescription(dcmTagBO.getSeriesDescription());
        qcInfo.setSeriesDate(dcmTagBO.getSeriesDate());
        qcInfo.setSeriesTime(dcmTagBO.getSeriesTime());
        return qcInfo;
    }
}
